home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AMISL083.ARJ / AMITSRS.C < prev    next >
C/C++ Source or Header  |  1992-04-19  |  2KB  |  70 lines

  1. /************************************************************************/
  2. /*                                    */
  3. /* AMITSRS.C    List TSRs using the alternate multiplex interrupt    */
  4. /* Public Domain 1992 Ralf Brown                    */
  5. /* Version 0.80                             */
  6. /* Last Edit: 4/19/92                            */
  7. /*                                                                      */
  8. /* Must be compiled in a large data model (compact recommended)        */
  9. /* ex.  TCC -mc AMITSRS                            */
  10. /*                                    */
  11. /************************************************************************/
  12.  
  13. #include <stdio.h>
  14. #include <dos.h>
  15.  
  16. int main(int argc,char **argv)
  17. {
  18.    int mpx ;
  19.    int did_banner = 0, verbose = 0 ;
  20.    union REGS regs ;
  21.    char far *sig ;
  22.    
  23.    /* prevent 'unused parameters' warnings */
  24.    (void)argv ;
  25.    /**/
  26.    /* if any commandline arguments, turn on verbose mode */
  27.    /**/
  28.    if (argc > 1)
  29.       verbose = 1 ;
  30.    /**/
  31.    /* loop through all 256 multiplex numbers, listing each signature we find */
  32.    /**/
  33.    for (mpx = 0 ; mpx <= 255 ; mpx++)
  34.       {
  35.       regs.h.ah = mpx ;
  36.       regs.h.al = 0 ;  /* installation check */
  37.       int86(0x2D,®s,®s) ;
  38.       if (regs.h.al == 0xFF) /* installed? */
  39.      {
  40.      if (!did_banner)
  41.         {
  42.         printf("Manufact  Product\t\tDescription\n") ;
  43.         printf("-------- -------- ----------------------------------------------\n") ;
  44.         did_banner = 1 ;
  45.         }
  46.      sig = MK_FP(regs.x.dx,regs.x.di) ;
  47.      printf("%8.8s %8.8s %.61s\n",sig,sig+8,sig+16) ;
  48.      /**/
  49.      /* if we were asked for a verbose display, also display TSR version */
  50.      /* and private API entry point (if present) on a second line         */
  51.      /**/
  52.      if (verbose)
  53.         {
  54.         printf("%18sversion %d.%02d","",regs.h.ch,regs.h.cl) ;
  55.         regs.h.ah = mpx ;
  56.         regs.h.al = 1 ;  /* get private entry point */
  57.         int86(0x2D,®s,®s) ;
  58.         if (regs.h.al == 0xFF)
  59.            printf("   entry point %04.4X:%04.4X ",regs.x.dx,regs.x.bx) ;
  60.         else
  61.            printf("   no private entry point") ;
  62.         printf("\n") ;
  63.         }
  64.      }
  65.       }
  66.    if (!did_banner)
  67.       printf("No TSRs are using the alternate multiplex interrupt\n") ;
  68.    return 0 ;
  69. }
  70.